<template>
<div>
  <div class="banner" @click="handleBannerClick">
    <img  class="banner-img" src="http://img1.qunarzz.com/sight/p0/1412/9f/fbff2a5302c0ce906ef9b64159730f89.water.jpg_600x330_b9a742ef.jpg">
    <div class="banner-info">
      <div class="banner-title">上海海洋水族馆(AAAA景区)</div>
      <div class="banner-number">
        <span class="iconfont banner-icon">&#xe632;</span>
        {{imgs.length}}</div>
    </div>
  </div>
  <fade-animation>
    <common-gallary
      :imgs="imgs"
      v-show="showGallary"
      @close="handleGallaryClose"
    >
  </common-gallary>
  </fade-animation>
</div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  data () {
    return {
      showGallary: false,
      imgs: ['http://img1.qunarzz.com/sight/p0/1412/2c/c633c219335726cb27b33c887997b1fc.water.jpg_r_800x800_3ea3f1ec.jpg', 'http://img1.qunarzz.com/sight/p0/201301/08/4905cefd7787e37e93835fbb.jpg_r_800x800_5b2bc2ee.jpg', 'http://img1.qunarzz.com/wugc/p132/201306/06/78f9ab37b265ae1593835fbb.jpg_r_800x800_a15e4f91.jpg', 'http://img1.qunarzz.com/sight/p0/201301/08/c467cdd5848562ef93835fbb.jpg_r_800x800_761bb637.jpg']
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style scoped lang="stylus">
.banner
  position: relative
  overflow: hidden
  height:0
  color: #fff
  padding-bottom: 55%
  .banner-img
    width:100%
  .banner-info
    display: flex
    position: absolute
    left:0
    right:0
    bottom:0
    font-size: .32rem
    line-height:.6rem
    background-image: linear-gradient(top,rgba(0,0,0,0) ,rgba(0,0,0,0.8))
    .banner-title
      padding:0 .2rem
      flex:1
    .banner-number
      margin-top:.16rem
      padding:0 .4rem
      line-height:.32rem
      height:.32rem
      font-size: .24rem
      border-radius: .2rem
      background :rgba(0,0,0,.8)
      .banner-icon
        font-size:.24rem
</style>
